package com.clt.ess.CABeen;

//证书内容变更请求(证书有效期不变)客户端请求参数Data（同步）
public class ChangeSealCertRequestData {
    //用于区分请求列表的单个请求
    //必须
    private String requestID;
    //需要变更的签名证书序列号
    //必须
    private String serialNumber;
    //证书类型：个人证书(“0”)、单位证书(“1”)、服务器证书(“2”)，大于 2 预留扩展
    //必须
    private String certType;
    //证书主体的国家项，2 个字节 CN
    //必须
    private String countryName;
    //证书主体的组织项，不大于 150 个字节
    //必须
    private String organizationName;
    //证书主体的名称项，不大于 200 个字节
    //必须
    private String commonName;
    //Base64 编码的签名公钥信息（该公钥是密码设备中存 储的签名私钥对应的公钥），不小于 64 字节注：证书公钥由 0x04(1 字节)+x 坐标(32 字节)+y 坐 标(32 字节)拼接而成，并做 base64 编码
    //必须
    private String subjectPublicKeyInfo;
    //SM2 椭圆曲线公钥密码算法 OID1.2.156.10197.1.301
    //必须
    private String algorithm;
    /**
     {
         " requestID ": "0",
         " serialNumber ": "被变更的签名证书序列号",
         " certType": "0",
         " countryName ": "CN",
         " organizationName ": "电子印章标识持有者对应的'统一社会信用代码+单位名称'组成。",
         "commonName ": "省市区(6 个字节) + 印章赋码（ 8 个字节） ",
         "subjectPublicKeyInfo ": "base64编码的公钥 ",
         "algorithm ": "1.2 .156 .10197 .1 .301"
     }
     */

    public ChangeSealCertRequestData() {
    }

    public ChangeSealCertRequestData(String requestID, String serialNumber, String certType, String countryName, String organizationName, String commonName, String subjectPublicKeyInfo, String algorithm) {
        this.requestID = requestID;
        this.serialNumber = serialNumber;
        this.certType = certType;
        this.countryName = countryName;
        this.organizationName = organizationName;
        this.commonName = commonName;
        this.subjectPublicKeyInfo = subjectPublicKeyInfo;
        this.algorithm = algorithm;
    }

    public String getRequestID() {
        return requestID;
    }

    public void setRequestID(String requestID) {
        this.requestID = requestID;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getCertType() {
        return certType;
    }

    public void setCertType(String certType) {
        this.certType = certType;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    public String getOrganizationName() {
        return organizationName;
    }

    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    public String getCommonName() {
        return commonName;
    }

    public void setCommonName(String commonName) {
        this.commonName = commonName;
    }

    public String getSubjectPublicKeyInfo() {
        return subjectPublicKeyInfo;
    }

    public void setSubjectPublicKeyInfo(String subjectPublicKeyInfo) {
        this.subjectPublicKeyInfo = subjectPublicKeyInfo;
    }

    public String getAlgorithm() {
        return algorithm;
    }

    public void setAlgorithm(String algorithm) {
        this.algorithm = algorithm;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"requestID\":\"")
                .append(requestID).append('\"');
        sb.append(",\"serialNumber\":\"")
                .append(serialNumber).append('\"');
        sb.append(",\"certType\":\"")
                .append(certType).append('\"');
        sb.append(",\"countryName\":\"")
                .append(countryName).append('\"');
        sb.append(",\"organizationName\":\"")
                .append(organizationName).append('\"');
        sb.append(",\"commonName\":\"")
                .append(commonName).append('\"');
        sb.append(",\"subjectPublicKeyInfo\":\"")
                .append(subjectPublicKeyInfo).append('\"');
        sb.append(",\"algorithm\":\"")
                .append(algorithm).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
